<?php
include '../common.php';
$rule = [
	'node_id' => ['kong','发表区域不能为空'],
 	'title'   => ['kong','发表标题不能为空'],
 	'content' => ['kong','发表内容不能为空'],
];
$a = panduan($rule);
if($a['code'] == 0){
	exit($a['msg']);
}

$node_id     = trim($_POST['node_id']);
$name        = trim($_COOKIE['name']);
$title       = trim($_POST['title']);
$content     = trim($_POST['content']);
$path_img    = '';
$time        = time();
$permissions = '0';

$sql  = "INSERT INTO publish (area,name,title,content,path_img,hour,permissions_id) VALUES ('$node_id','$name', '$title','$content','$path_img','$time','$permissions')";
$row = insert($sql,$DB);
if (!$row) {
	exit('增加失败');
}
header("location:../../index.php",302);